package com.huicoo.forestmanager.ui.patrol.PatrolRecordDetailsActivity;

import android.widget.TextView;

import com.huicoo.forestmanager.R;
import com.huicoo.forestmanager.base.BaseFragment;
import com.huicoo.forestmanager.network.bean.patrol.RecorddetailsBean;

import butterknife.BindView;

/**
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2019/4/9		    巡查记录基本信息
 */
public class PatrolRecordBasicInformationFragment extends BaseFragment {
    //林  班  号
    @BindView(R.id.serial_number)
    TextView serial_number;

    //处理结果
    @BindView(R.id.division)
    TextView division;

    //巡查人员
    @BindView(R.id.personnel)
    TextView personnel;

    //开始时间
    @BindView(R.id.start_time)
    TextView start_time;

    //结束时间
    @BindView(R.id.end_time)
    TextView end_time;

    //耗时
    @BindView(R.id.elapsed_time)
    TextView elapsed_time;

    //巡查地点
    @BindView(R.id.patrol_site)
    TextView patrol_site;

    //巡护情况
    @BindView(R.id.patrol_situation)
    TextView patrol_situation;


    private RecorddetailsBean.Data mData;


    public static PatrolRecordBasicInformationFragment getInstance() {
        return new PatrolRecordBasicInformationFragment();
    }


    @Override
    protected int getLayoutId() {
        return R.layout.fragment_patrol_record_basic_information;
    }

    @Override
    protected void initView() {
        mData = (RecorddetailsBean.Data) getArguments().getSerializable("data");
        //填充数据
        paddingData();
    }

    //填充数据
    private void paddingData() {
        //天气
        serial_number.setText(mData.getWeather());

        //处理结果
        division.setText(mData.getDealResult());

        //巡查人员
        personnel.setText(mData.getUserName());

        //开始时间
        start_time.setText(mData.getStartTime());

        //结束时间
        end_time.setText(mData.getEndTime());

        //耗时
        elapsed_time.setText(mData.getDifTime());

        //巡查地点
        patrol_site.setText(mData.getPosition());

        //巡护情况
        patrol_situation.setText(mData.getRecordSituation());
    }


}
